
path='C:\\Users\\SHINEION\\PycharmProjects\\First_Test\\Myxlsxdata/Book.xlsx'
from PIL import ImageGrab
import win32com.client as win32

excel = win32.gencache.EnsureDispatch('Excel.Application')
workbook = excel.Workbooks.Open(path)

for sheet in workbook.Worksheets:
    for i, shape in enumerate(sheet.Shapes):
        if shape.Name.startswith('Picture'):
            shape.Copy()
            image = ImageGrab.grabclipboard()

            import matplotlib.pyplot as plt  # plt 用于显示图片
            import matplotlib.image as mpimg  # mpimg 用于读取图片
            import numpy as np
            for i in range(1,9):
                lena = mpimg.imread(image[i])  # 读取和代码处于同一目录下的 lena.png
                # 此时 lena 就已经是一个 np.array 了，可以对它进行任意处理
                lena.shape  # (512, 512, 3)
                plt.imshow(lena)  # 显示图片
                plt.axis('off')  # 不显示坐标轴
                plt.show()



